Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): fix data race in follower controller #574

Merged
merged 1 commit into from
Nov 15, 2024
Merged

Conversation

mattisonchao
Copy link
Member

Motivation

WARNING: DATA RACE
Write at 0x00c000676410 by goroutine 408:
  github.com/streamnative/oxia/server.(*followerController).setLogger()
      /home/runner/work/oxia/oxia/server/follower_controller.go:179 +0x2d2
  github.com/streamnative/oxia/server.(*followerController).NewTerm()
      /home/runner/work/oxia/oxia/server/follower_controller.go:296 +0x4c4
  github.com/streamnative/oxia/server.(*internalRpcServer).NewTerm()
      /home/runner/work/oxia/oxia/server/internal_rpc_server.go:125 +0x941
  github.com/streamnative/oxia/proto._OxiaCoordination_NewTerm_Handler.func1()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:207 +0xbe
  github.com/grpc-ecosystem/go-grpc-prometheus.init.(*ServerMetrics).UnaryServerInterceptor.func3()
      /home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/server_metrics.go:107 +0xbb
  github.com/streamnative/oxia/proto._OxiaCoordination_NewTerm_Handler()
      /home/runner/work/oxia/oxia/proto/replication_grpc.pb.go:209 +0x1f3
  google.golang.org/grpc.(*Server).processUnaryRPC()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1394 +0x1b4b
  google.golang.org/grpc.(*Server).handleStream()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1805 +0x1824
  google.golang.org/grpc.(*Server).serveStreams.func2.1()
      /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1029 +0x158

Previous read at 0x00c000676410 by goroutine 23:
  github.com/streamnative/oxia/server.(*followerController).Close()
      /home/runner/work/oxia/oxia/server/follower_controller.go:192 +0x50
  github.com/streamnative/oxia/server.(*shardsDirector).Close()
      /home/runner/work/oxia/oxia/server/shards_director.go:243 +0x30b
  github.com/streamnative/oxia/server.(*Server).Close()
      /home/runner/work/oxia/oxia/server/server.go:134 +0xba
  github.com/streamnative/oxia/tests/security/auth.newOxiaClusterWithAuth.func2()
      /home/runner/work/oxia/oxia/tests/security/auth/auth_oidc_test.go:116 +0x78
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.23.3/x64/src/runtime/panic.go:605 +0x5d
  testing.tRunner()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1690 +0x226
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.23.3/x64/src/testing/testing.go:1743 +0x44

@merlimat merlimat merged commit 1c66544 into main Nov 15, 2024
7 checks passed
@merlimat merlimat deleted the fix.data.race branch November 15, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants